1. Field of the Invention
The present invention relates to an absolute value circuit, and more specifically an absolute value circuit for use in a digital signal processing circuit for converting N-bit data expressed in the form of a 2's complement into an absolute value data (N is positive integer).
2. Description of Related Art
One of typical conventional absolute value circuit has been fundamentally composed of a data inverting circuit, an adding circuit and a data selection circuit.
N-bit data expressed in a 2's complement is inputted to the data inverting circuit and one input of the data selection circuit. The input data supplied to the data inverting circuit is inverted in all bits, and an inverted data is supplied to the adding circuit, where "1" is added to the least significant bit of the inverted data. The result of addition is supplied to the other input of the data selection circuit.
Thus, because of the characteristics of the N-bit data expressed in a 2's complement, converted data which is a negative number of the input data can be obtained by inverting all bits of the input data and adding "1" to the least significant bit of the inverted data.
A relation between the input data and the converted data is that the converted data is ceaselessly a negative number of the input data, which can be exemplified in such an example that if the input data is +5, the converted data is -5, and if the input data is -5, the converted data is +5.
As mentioned above, the input data and the converted data are supplied to the data selection circuit. Namely, positive data and negative data of a given value supplied as the input data are necessarily supplied to the selection circuit. In addition, whether the input data is positive data or negative data is discriminated on the basis of whether the most significant bit of the input data (namely, the sign bit of the 2's compliment) is "1" or "0". Therefore, the most significant bit of the input data is applied to an control input of the data selection circuit, so that the data selection circuit selects either the input data or the converted data, whereby a positive data is ceaselessly outputted. Thus, the input data is converted into an absolute value data. Namely, an absolute value circuit can be realized.
In the above mentioned absolute value circuit, the data inverting circuit is a conventional inverter circuit of N bits corresponding to the number of bits of an input data, the inverter circuit operating to inverting each bit of the input N-bit data in such a manner that "1" is converted into "0" and "0" is converted into "1".
As the adding circuit and the data selection circuit, "The Bipolar Digital Integrated Circuits Data Book PART 1" published by Japanese Texas Instruments Corporation in 1981 discloses specific examples, and therefore, it is here referred to. A specific circuit example of the adding circuit is disclosed on Page 7-42 of the data book, in which a 4-bit adding circuit is composed of 36 gate circuits. In addition, a specific circuit example of the data selection circuit is disclosed on Page 7-170 of the data book, in which a 4-bit data selection is formed of 15 gate circuits.
However, the adding circuit and the data selection circuit of the above mentioned prior art absolute value circuit should be considered to have a bit structure corresponding to the N-bit input data.
In the conventional absolute value circuit as mentioned above, assuming that the input data is of 4 bits, four inverters (gate circuits) are required for the data inverting circuit, and 36 gate circuits and 15 gate circuits are required for the adding circuit and the data selection circuit, respectively. Namely, 55 gate circuits are required in total.
As mentioned above, the conventional absolute value circuit is complicated in circuit construction and large in circuit scale.